package com.xjoyt.pay.actuator.po;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xjoyt.pay.constants.DateConstant;

@Entity
@Table(name = "t_server")
public class Server {

	@Id
	@GeneratedValue(generator = "uuid")
	@GenericGenerator(name = "uuid", strategy = "uuid2")
	@Column(name = "server_id", length = 36)
	public String id;

	/**
	 * 服务器名称
	 */
	@Column(name = "`name`", length = 50)
	public String name;

	/**
	 * 录入日期
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "added_date")
	@JsonFormat(pattern = DateConstant.DATE_TIME_FORMAT_PATTERN, timezone = "GMT+8")
	public Date addedDate;

	/**
	 * 是否开启
	 */
	@org.hibernate.annotations.Type(type = "yes_no")
	@Column(name = "is_enabled")
	public Boolean enabled;

	/**
	 * 监控状态地址
	 */
	@Column(name = "health_url", length = 255)
	public String healthUrl;
}
